package com.jsyl.lwbk.business.domain;

import com.jsyl.lwbk.common.utils.DateUtils;
import com.jsyl.lwbk.common.utils.StringUtils;
import lombok.Data;

import java.util.Date;

/**
 * 学生信息表
 */
public class Child {
    /**
     * 编号
     */
    private Long id;
    /**
     * 姓名
     */
    private String name;
    /**
     * 手机号
     */
    private String phone;
    /**
     * 性别：
     * 1：男；
     * 0：女
     */
    private Byte sex;
    /**
     * 中心编号
     */
    private Long centerId;
    /**
     * 生日（年YYYY）
     */
    private String birthYear;
    /**
     * 生日（月MM）
     */
    private String birthMonth;
    /**
     * 生日（日DD）
     */
    private String birthDay;
    /**
     * 是否会员：0 储备客户 1 会员 2 非会员
     */
    private Byte isMember;
    /**
     * 会员编号
     */
    private String sn;
    /**
     * 年级
     */
    private Byte grade;


    private String createUser;
    /**
     * 创建时间
     */
    private Date createTime;


    private String updateUser;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 删除状态：0:正常,1:冻结,2:删除
     */
    private Integer status;

    /**
     * 0-其他，1-修改
     */
    private Integer opType;

    private transient String birthdayStr;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Byte getSex() {
        return sex;
    }

    public void setSex(Byte sex) {
        this.sex = sex;
    }

    public Long getCenterId() {
        return centerId;
    }

    public void setCenterId(Long centerId) {
        this.centerId = centerId;
    }

    public String getBirthYear() {
        return (!StringUtils.isEmpty(birthdayStr)&& birthdayStr.contains("-"))?birthdayStr.split("-")[0]:birthYear;
    }

    public void setBirthYear(String birthYear) {
        this.birthYear = birthYear;
    }

    public String getBirthMonth() {
        return (!StringUtils.isEmpty(birthdayStr)&& birthdayStr.contains("-"))?birthdayStr.split("-")[1]:birthMonth;
    }

    public void setBirthMonth(String birthMonth) {
        this.birthMonth = birthMonth;
    }

    public String getBirthDay() {
        return (!StringUtils.isEmpty(birthdayStr)&& birthdayStr.contains("-"))?birthdayStr.split("-")[2]:birthDay;
    }

    public void setBirthDay(String birthDay) {
        this.birthDay = birthDay;
    }

    public Byte getIsMember() {
        return isMember;
    }

    public void setIsMember(Byte isMember) {
        this.isMember = isMember;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public Byte getGrade() {
        return grade;
    }

    public void setGrade(Byte grade) {
        this.grade = grade;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getOpType() {
        return opType;
    }

    public void setOpType(Integer opType) {
        this.opType = opType;
    }

    public String getBirthdayStr() {
        return birthdayStr;
    }

    public void setBirthdayStr(String birthdayStr) {
        this.birthdayStr = birthdayStr;
    }



}